package com.example.aesdemo.config;

import com.example.aesdemo.interceptor.DataEncryptionInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @description: MVC配置
 * @author: Mr.Hu
 * @create: 2018-05-31 11:41
 **/
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private DataEncryptionInterceptor dataEncryptionInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(dataEncryptionInterceptor).addPathPatterns("/**");
    }
}
